<%@ page import="top.wuyang.study.javawebjdbc.entity.TbMovie" %>
<%@ page import="java.util.List" %>
<%@ page import="top.wuyang.study.javawebjdbc.dao.TbMovieDAO" %><%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2024/5/28
  Time: 14:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>页面</title>
    <link href=../../lib/bootstarp.min.css rel="stylesheet">
</head>
<body>

<a href="insert.jsp">目录</a>


<%
    List<TbMovie> list = TbMovieDAO.query();
%>



<div style="padding: 1rem">
    <div>
        <a class="btn btn-success" href="insert.jsp">发布电影信息</a>
    </div>

    <div>
        <h2>电影列表</h2>
    </div>

    <table class="table table-hover table-striped table-bordered ">
        <thead>
        <tr class="text-bg-success">
            <th>编号</th>
            <th>电影名称</th>
            <th>电影简介</th>
            <th>电影评分</th>
            <th>上映时间</th>
            <th>操作</th>
        </tr>
        </thead>

        <tbody>
        <%  for (TbMovie tbMovie : list) {  %>
        <tr>
            <td><%=tbMovie.getId()%>
            </td>
            <td><%=tbMovie.getMovie()%>
            </td>
            <td><%=tbMovie.getInfo()%>
            </td>
            <td><%=tbMovie.getScore()%>
            </td>
            <td><%=tbMovie.getCreated()%>
            </td>
            <td>
                <a class="btn btn-sm btn-danger" href="delete.jsp?id=<%=tbMovie.getId()%>">删除</a>
            </td>
        </tr>
        <% } %>
        </tbody>
    </table>

</div>

<script src="../../lib/bootstarp.min.js"></script>

</body>
</html>
